<!--
 * @description 组件
 * @author: 陈陈
 * @date: 2025/05/09
 * @phone: 18560000860
 * @email: 18560000860@qq.com
 * @company: 济南晨霜信息技术有限公司 /
 * @business: 承接前后端项目的开发
-->
<template>
	<view
		class="pure-richtext-parse"
		:class="_classes"
		:style="_styles"
		:hover-class="hoverClass"
		@tap="_handleClick"
	></view>
</template>

<script>
	import commonComponentOptions from "../../config/options";
	export default {
		options: commonComponentOptions
	};
</script>

<script setup>
	import { ref, computed } from "vue";
	import props from "./props";
	import { isArray } from "@/uni_modules/pure-utils";

	// -------------------------------------------------------------------------------- Refs
	const _content = computed(() => {
		return _parseNodes(_props.nodes);
	});

	// -------------------------------------------------------------------------------- Props
	const _props = defineProps(props);

	// -------------------------------------------------------------------------------- Emits
	const _emits = defineEmits(["onClick"]);

	// -------------------------------------------------------------------------------- Classes
	const _classes = computed(() => {
		const array = [];
		return array;
	});

	// -------------------------------------------------------------------------------- Styles
	const _styles = computed(() => {
		const array = [];
		return array;
	});

	// -------------------------------------------------------------------------------- Events
	// 点击事件
	function _handleClick() {
		_emits("onClick");
	}

	// 解析富文本内容
	function _parseNodes(nodes = "") {
		if (isArray(nodes)) nodes = nodes.join("");

		// HTML 块级标签列表
		const blockTags = [
			"p",
			"div",
			"h1",
			"h2",
			"h3",
			"h4",
			"h5",
			"h6",
			"ul",
			"ol",
			"li",
			"table",
			"tr",
			"td",
			"th",
			"thead",
			"tbody",
			"tfoot"
		];
	}
</script>

<style scoped lang="scss">
	@import "./style.scss";
</style>
